#include <iostream>
#include <vector>

int find(const std::vector<std::pair<int, int>> &points,
         std::pair<int, int> pt)
{
    int idx = -1;
    for (int i = 0; i < points.size(); i++)
    {
        if (pt == points[i])
        {
            idx = i;
            break;
        }
    }

    return idx;
}

int main()
{
    std::vector<std::pair<int, int>> points;
    int N;
    std::cin >> N;
    for (int i = 0; i < N; i++)
    {
        int x, y;
        std::cin >> x >> y;
        points.push_back({x, y});
    }

    int cnt = 0;
    for (int i = 0; i < N; i++)
    {
        for (int j = i + 1; j < N; j++)
        {
            int x1 = points[i].first - points[i].second + points[j].second;
            int y1 = points[i].second + points[i].first - points[j].first;

            int x2 = points[j].first + points[j].second - points[i].second;
            int y2 = points[j].second - points[j].first + points[i].first;

            if ((find(points, {x1, y1}) != -1) && (find(points, {x2, y2}) != -1))
            {
                cnt++;
            }

            int x3 = points[i].first + points[i].second - points[j].second;
            int y3 = points[i].second - points[i].first + points[j].first;

            int x4 = points[j].first - points[j].second + points[i].second;
            int y4 = points[j].second + points[j].first - points[i].first;

            if ((find(points, {x3, y3}) != -1) && (find(points, {x4, y4}) != -1))
            {
                cnt++;
            }
        }
    }

    std::cout << cnt / 4 << std::endl;

    return 0;
}